package com.countryside.mapper;


import com.countryside.pojo.EmployeeProject;
import com.countryside.pojo.EmployeeWork;

import com.countryside.pojo.query.CompanyWorkQuery;
import com.countryside.pojo.query.EmployeeWorkQuery;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.lang.Nullable;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface EmployeeWorkMapper {

    /**
     * 查询出工人信息
     * @param employeeWorkQuery
     * @return
     */
    List<EmployeeWork> listEmployeeWork(EmployeeWorkQuery employeeWorkQuery);

    /**
     * 搜索工人信息
     * @param employeeWorkQuery
     * @return
     */
    List<EmployeeWork> listEmployeeWorkBySearch(EmployeeWorkQuery employeeWorkQuery);



    /**
     * 完善工人工作信息
     * @param employeeWork
     * @return
     */
    int addEmployeeWork(EmployeeWork employeeWork);

    /**
     * 修改个人工作信息
     * @param employeeWork
     * @return
     */
    int updateEmployeeWork(EmployeeWork employeeWork);

    /**
     * 通过用户id获取工人信息
     * @param userId
     * @return
     */
    EmployeeWork getEmployeeWork(@Param("userId") String userId);



    /**
     * 根据种类筛选出相应的工人信息
     * @param expectedWork
     * @return
     */
    List<EmployeeWork> queryEmployeeWorkByExpectedWork(@Param("expectedWork") String expectedWork);

    /**
     * 根据地址筛选出相应工人信息
     * @param address
     * @return
     */
    List<EmployeeWork> queryEmployeeWorkByAddress(@Param("address") String address, @Nullable @Param("start") Integer start, @Nullable @Param("limit") Integer limit);

    /**
     * 根据地址和工种筛选出相应工人信息
     * @param expectedWork
     * @param address
     * @return
     */
    List<EmployeeWork> queryEmployeeWorkByAddressAndExpectedWork(@Param("expectedWork") String expectedWork, @Param("address") String address);

    /**
     * 根据工人ID查询工人信息
     * @param id
     * @return
     */
    EmployeeWork queryEmployeeByEmployeeId(@Param("id")Integer id);

}
